package com.hb0730.boot.admin.modules.sys.system.model.vo;

import cn.hutool.core.util.StrUtil;
import com.hb0730.boot.admin.base.util.AesEncryptUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 用户信息
 *
 * @author <a href="mailto:huangbing0730@gmail">hb0730</a>
 * @date 2023/6/8
 */
@Data
@EqualsAndHashCode
@ToString
public class UserVO implements Serializable {
    /**
     * ID
     */
    @Schema(description = "id")
    protected String id;

    /**
     * 创建人
     */
    @Schema(description = "创建人")
    protected String createdBy;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    protected LocalDateTime created;

    /**
     * 更新人
     */
    @Schema(description = "更新人")
    protected String modifiedBy;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    protected LocalDateTime modified;
    /**
     * 用户名
     */
    @Schema(description = "用户帐号")
    @NotBlank(message = "用户帐号不能为空")
    private String username;
    /**
     * 用户密码
     */
    @Schema(description = "用户密码")
    private String password;
    /**
     * 用户昵称
     */
    @Schema(description = "用户昵称")
    private String nickname;
    /**
     * 性别
     */
    @Schema(description = "性别")
    private Integer sex;
    /**
     * 身份证号
     */
    @Schema(description = "身份证号")
    private String idnumber;
    /**
     * 手机号
     */
    @Schema(description = "手机号")
    private String phone;
    /**
     * 院系部门
     */
    @Schema(description = "院系部门")
    private String department;
    /**
     * 专业
     */
    @Schema(description = "专业")
    private String major;
    /**
     * 职称
     */
    @Schema(description = "职称")
    private String jobtitle;
    /**
     * 学位
     */
    @Schema(description = "学位")
    private String degree;
    /**
     * 民族
     */
    @Schema(description = "民族")
    private String nation;
    /**
     * 邮箱
     */
    @Schema(description = "邮箱")
    private String email;
    /**
     * 毕业院校
     */
    @Schema(description = "毕业院校")
    private String graduate;
    /**
     * 是否启用
     */
    @Schema(description = "是否启用")
    private Integer isEnabled;
    /**
     * 是否启用
     *
     * @return .
     */
    @Schema(description = "是否启用")
    public boolean isEnabled() {
        if (null == isEnabled) {
            return false;
        }
        return isEnabled == 1;
    }
    /**
     * 角色id集合
     */
    @Schema(description = "角色id集合")
    private List<String> roleIds;
}
